import Vue from 'vue'
import App from './App'
import jtLay from './util/jtLay'
import util from './util/util'
import router from './router'
import axios from 'axios'
import jquery from 'jquery'

// import moment from 'moment'
import * as filters from './util/filter'

Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));//注册过滤器

Vue.config.productionTip = false
axios.defaults.timeout = 600000; //设置timeout  60s
axios.defaults.baseURL = g.url;
Vue.prototype.$http = axios;
Vue.prototype.$util = util.util;
// Vue.prototype.$ = jquery;
window.$ = jquery;

//测试 自写弹窗插件
Vue.use(jtLay)

// 时间格式化插件moment
Vue.filter('moment', function (value, formatString) {
    formatString = formatString || 'YYYY-MM-DD HH:mm:ss';
    return moment(value).format(formatString);
});


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
